package com.mj.listen1._13_优先级队列;

public class Person implements Comparable<Person> {

    private String name;
    private int boneBreak;

    public Person(String name, int boneBreak) {
        this.name = name;
        this.boneBreak = boneBreak;
    }

    @Override
    public int compareTo(Person p) {
        // 返回值大于零，this往上排，对应的优先级越高
        return this.boneBreak - p.boneBreak;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", boneBreak=" + boneBreak +
                '}';
    }
}
